package com.gxm.面试.基础;

import org.junit.Test;

public class Object {

    /**
     * ==与equals的区别
     * hashcode相等的两个对象,==一定相等么?equeals一定相等么?
     * 两个对象equals相等,Name他们的hashcode相等吗?
     *
     */
    @Test
    public void test01(){
        String s1 = "s";
        String s2 = "s";
        System.out.println(s1.equals(s2));
        System.out.println(s1 == s2);
        System.out.println(String.format("s1[hashcode]=[%s],s2[hashcode]=[%s]",s1.hashCode(),s2.hashCode()));
    }
}
